#include "sevenbox/fakeos/fakeos.h"
#include "stdio.h"

struct fakeos_process_context main_context;

MY_UINT32_T(test1);

PROCESS(main_thread, "main_thread");
PROCESS_THREAD(main_thread, ev, data)
{
    PROCESS_BEGIN();
    while (1) {
        PROCESS_WAIT_EVENT();
        printf("main_thread: ev:%x test1:%d\n", ev, test1);
        test1++;
    }
    PROCESS_END();
}

int main(int argc, char *argv[])
{
    process_init(&main_context);
    process_start(&main_context, &main_thread, NULL);

    while (1) {
        process_run(&main_context);
        process_post(&main_context, &main_thread, EV_PROCESS_USER_MIN, NULL);
    }

    return 0;
}
